package com.example.harmonet.harmtorch;

public class Sigmoid implements Layer{

    @Override
    public Tensor forward(Tensor in){
        Tensor out = new Tensor(in.dim());
        for(int i = 0; i < in.tensor().length; i++){
            out.tensor()[i] = (float)1.0 / (1 + (float)Math.exp(-in.tensor()[i]));
        }
        return out;
    }

    @Override
    public int getParam(){
        return 0;
    }

    @Override
    public void init(float[] par){

    }
}


